#!/bin/bash


G='grandes'
M='medianas'
P='pequenas'




# TABOO SEARCH
echo === TABOO ===

mkdir -p res/res_taboo/
for fam in `ls instancias`
do
    
    for f in `ls instancias/${fam}`
    do
	echo ${f}

	mkdir -p res/res_taboo/${fam}
	head -1 instancias/${fam}/${f} > res/res_taboo/${fam}/${f}

	for i in `seq 1 20`
	do
	    if [ "$fam" == 'grandes'  ]; 
	    then
		./js -f instancias/${fam}/${f} -v 1 -a -n 90 | tail -1 >> res/res_taboo/${fam}/${f}  

	    elif [ "$fam" == 'medianas' ]; 
	    then
	     	./js -f instancias/${fam}/${f} -v 1 -a -n 35 | tail -1 >> res/res_taboo/${fam}/${f}  
	    elif [ "$fam"=="pequenas" ]; 
	    then
		./js -f instancias/${fam}/${f} -v 1 -a -n 10 | tail -1 >> res/res_taboo/${fam}/${f}  
	    fi

	done

    done
done



# GRASP
echo === GRASP ===


for fam in `ls instancias`
do
    
    for f in `ls instancias/${fam}`
    do
	echo ${f}
	mkdir -p res/res_grasp/${fam}
	head -1 instancias/${fam}/${f} > res/res_grasp/${fam}/${f}

	for i in `seq 1 5`
	do
	    a=0.3
	    if [ "$fam" == 'pequenas' ]; 
	    then
		a=0.5
	    fi
	    ./grasp -f instancias/${fam}/${f} -a ${a} -n 2000  | tail -1 >> res/res_grasp/${fam}/${f}  
	    
	done

    done
done

# HORMIGA
echo === HORMIGA ===

#GENETICO

#GENETICO HIBRIDO

